package ru.ifmo.thesis.task;

import java.util.List;

import ru.ifmo.thesis.domain.Job;
import ru.ifmo.thesis.domain.Worker;

public class Task {
	private final List<Worker> workers;
	
	private final List<Job> jobs;

	public Task(List<Worker> workers, List<Job> jobs) {
		if (workers == null) {
			throw new AssertionError("argument can't be null");
		}
		
		if (jobs == null) {
			throw new AssertionError("argument can't be null");
		}
		
		this.workers = workers;
		this.jobs = jobs;
	}

	public List<Worker> getWorkers() {
		return workers;
	}

	public List<Job> getJobs() {
		return jobs;
	}
	
	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return super.hashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		
		if (!this.getClass().isAssignableFrom(obj.getClass())) {
			return false;
		}
		
		Task other = (Task) obj;
		
		return jobs.equals(other.jobs) && workers.equals(other.workers);
	}
}
